package com.heima.article;

import com.heima.model.article.pojos.ApArticle;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "leadnews-article" ,contextId = "article" , path = "/api/v1/article")
public interface ApArticleFeign {

    /**
     * 根据id修改文章
     * @param apArticle
     * @return
     */
    @PostMapping("/update")
    ResponseResult update(@RequestBody ApArticle apArticle);


    /**
     * 根据id删除文章
     * @param id
     * @return
     */
    @DeleteMapping("/{id}")
    public ResponseResult delete(@PathVariable(value = "id" ,required = true) Long id);
}
